---
id: auth-onauthstatechange
title: "auth.onAuthStateChange()"
slug: auth-onauthstatechange
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Receive a notification every time an auth event happens.

<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
supabase.auth.onAuthStateChange((event, session) => {
  console.log(event, session)
})
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>

## Parameters


<ul className="method-list-group">
  
<li className="method-list-item">
  <h4 className="method-list-item-label">
    <span className="method-list-item-label-name">
      callback
    </span>
    <span className="method-list-item-label-badge required">
      required
    </span>
    <span className="method-list-item-validation">
      object
    </span>
  </h4>
  <div class="method-list-item-description">

No description provided. 
  
  </div>
  
</li>

</ul>














## Examples

### Listen to auth changes



<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
supabase.auth.onAuthStateChange((event, session) => {
  console.log(event, session)
})
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>